package com.hzsun.spring;

import com.hzsun.spring.component.FactoryBeans;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.concurrent.CountDownLatch;

/**
 * @Author: DingJl
 * @Date: 2022/1/17 10:18
 * @Version 1.0
 */
public class Application {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(Config.class);
        context.refresh();
        context.getBean(FactoryBeans.class).print();
        CountDownLatch latch=new CountDownLatch(1);
        try {
            latch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
